package com.lieve.tomcat;

/**
 * @author sunlijiang
 * @date 2020/4/2
 */
public class MyThreadLocalTest {
    private static MyThreadLocal threadLocal = new MyThreadLocal();
    public static void main(String[] args) {
        threadLocal.set("Hello");
        System.out.println(Thread.currentThread().getName() + " " + threadLocal.get());
        Thread2 thread2 = new Thread2();
        thread2.start();
    }

    static class Thread2 extends Thread {
        @Override
        public void run() {
            super.run();
            System.out.println(threadLocal.get());
        }
    }
}
